<template>
  <el-dropdown @command="handleCommand">
  <span class="el-dropdown-link">
    {{ $t('Top.language') }}<i class="el-icon-arrow-down el-icon--right"></i>
  </span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item command="ch">{{ $t('Top.languageType.ch') }}</el-dropdown-item>
      <el-dropdown-item command="en">{{ $t('Top.languageType.en') }}</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>
export default {
  name: 'I18n',
  methods: {
    handleCommand(command) {
      this.$i18n.locale = command
    }
  }
}
</script>

<style scoped>
</style>